package com.ccepc.algmanage.service.impl;

import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ccepc.algmanage.mapper.RemoteHistoryMapper;
import com.ccepc.algmanage.service.PlcConfigService;
import com.ccepc.algmanage.service.RemoteHistoryService;
import com.ccepc.algmanage.utils.AuthInfoUtils;
import com.ccepc.common.core.util.R;
import com.ccepc.demo.api.entity.PlcConfig;
import com.ccepc.demo.api.entity.RemoteHistory;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.time.LocalDateTime;

/**
 *
 *
 * @author pigx code generator
 * @date 2023-11-02 15:49:01
 */
@Service
public class RemoteHistoryServiceImpl extends ServiceImpl<RemoteHistoryMapper, RemoteHistory> implements RemoteHistoryService {

    @Transactional
    @Override
    public R historySave(RemoteHistory remoteHistory) {
        remoteHistory.setActPerson(AuthInfoUtils.getFullName());
        remoteHistory.setActTime(LocalDateTime.now());
        // 修改远程控制状态
        return R.ok(this.save(remoteHistory));
    }
}
